#ifndef __UM_TIM_H
#define __UM_TIM_H

#include "mcu.h"

#if defined(STM32F4XX_LD)  || defined(STM32F4XX_MD) || defined(STM32F4XX_HD) || defined(STM32F4XX)
#include "stm32f40x_tim.h"
#define TIM1_IRQn      TIM1_UP_TIM10_IRQn
#elif defined(STM32F10X_LD)  || defined(STM32F10X_MD) || defined(STM32F10X_HD)
#include "stm32f10x_tim.h"
#define TIM1_IRQn      TIM1_UP_IRQn
#endif



#pragma pack(1)
typedef struct
{
	u32 sys_5ms_event   : 1;
	u32 sys_10ms_event  : 1;
	u32 sys_100ms_event : 1;
	u32 dummy           : 29;
	s32 sys_sec;
	s32 systicks;
} UM_SYS_TimerFlag;
#pragma pack()

extern UM_SYS_TimerFlag     UM_SYS_TIMER;

extern void UM_Systick_Handler();

extern void UM_TimInit(TIM_TypeDef* TIMx,u16 Prescaler,u16 Period,u8 div);


#endif
